<?php

declare(strict_types=1);

namespace app\admin\controller\order;

use app\admin\controller\Controller;
use app\admin\model\order\OilCard as OilCardOrder;

class OilCard extends Controller
{
    /**
     * @api {GET} /admin/order.oilCard 油卡订单列表
     */
    public function index()
    {
        $model = new OilCardOrder();
        $data = input('post.');

        return $model->getList($data);
    }

    /**
     * 退款.
     */
    public function refund()
    {
        $model = new OilCardOrder();
        $res = $model->refund(input('post.id'));
        if (false === $res) {
            return fail($model->getError());
        }

        return success('退款成功');
    }
}
